{{#neq page.viewStyle 'DEFAULT'}}
{{> @macro/plugins/view-style/view-style.hbs page=page type="VUE"}}
{{else}}
<template>
  {{#if page.psSysPFPlugin}}
  {{> @macro/plugins/view/view-use.hbs appPlugin=page.psSysPFPlugin}}
  {{else}}
    {{#if page.psViewLayoutPanel.useDefaultLayout}}
  <AppViewLayout :class="classNames">
    <template v-if="!noViewCaption && model.showCaption" #viewHeaderLeft>
      <div class="view-header__left__caption">
        {{> @macro/view/view-caption.hbs}}
        {{> @macro/view/view-datainfo-bar.hbs}}
      </div>
    </template>
    <template #viewHeaderRight>
      {{#each page.ctrls as | ctrl |}}
        {{#eq ctrl.controlType 'TOOLBAR'}}
      <div class="view-header__right__toolbar">
        {{> @macro/widgets/toolbar/toolbar.hbs page=page ctrl=ctrl}}
      </div>
        {{/eq}}
      {{/each}}
    </template>
    <template #default>
      {{#each page.ctrls as | ctrl |}}
        {{#eq ctrl.controlType 'FORM'}}
        {{> @macro/widgets/form-detail/form.hbs ctrl=ctrl}}
        {{/eq}}
      {{/each}}
    </template>
    {{> @macro/view/view-msg.hbs}}          
  </AppViewLayout>
    {{else}}
  <div :class="classNames">
      {{#if page.psViewLayoutPanel.rootPSPanelItems}}
        {{#each page.psViewLayoutPanel.rootPSPanelItems as | panelItem |}}
    {{> @macro/widgets/panel-detail/include-panel.hbs type=panelItem.itemType item=panelItem isMultiData=false panel=page.psViewLayoutPanel page=page}}
        {{/each}}
      {{/if}}
    </div>
    {{/if}}
  {{/if}}
</template>

<script lang="ts" setup>
// 基于template/src/views/\{{appModules}}/\{{pages@DEEDITVIEW}}/\{{spinalCase page.codeName}}.vue.hbs生成
  {{#if page.psViewLayoutPanel.useDefaultLayout}}
import { AppViewLayout } from "@components/layout/view-layout";
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
  {{else}}
import { AppCtrlPos, AppScrollContainer, AppSimpleFlexContainer, AppStandardContainer, AppTabPanel, AppTabPage } from '@components/layout-element/structure';
    {{#if page.psViewLayoutPanel.viewProxyMode}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.psViewLayoutPanel.psControls}}
    {{else}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
    {{/if}}
  {{/if}}
import { model } from './{{spinalCase page.codeName}}-model';
import {
  useNavParamsBind,
  useEventBind,
  handleToolbarItemClick,
  {{#unless page.psViewLayoutPanel.useDefaultLayout}}
  handleComponentAction,
  {{/unless}}
  handleCtrlAction,
  handleCtrlInit,
  handleCtrlDestroy,
  getViewClassNames,
} from "@/hooks/use-view";
import { EditViewActionType, IContext, IParam, IEditViewAbility, IEditViewControllerParams, IEditViewStore, EditViewController, IEditViewController, ILoadingHelper, IEditFormAbility, IEvent } from '@/core';

{{> @macro/view/view-props.hbs}}

{{> @macro/common/emit.hbs name="view" actionType="EditViewActionType" ability="IEditViewAbility"}}
//  样式名称
const classNames = computed(() => {
  return getViewClassNames(model, props);
});

const params: IEditViewControllerParams<EditViewActionType, IEditViewAbility> = {
  name: props.name,
  model,
  evt,
  isLoadDefault: props.isLoadDefault,
  openType: props.openType,
  pLoadingHelper: props.pLoadingHelper,
  handler: (data: IEditViewStore) => { return reactive(data)}
};

{{> @macro/common/controller.hbs name="view" IController="IEditViewController" store="IEditViewStore" ability="IEditViewAbility" controller="EditViewController"}}
</script>
{{/neq}}
